<style lang="less">
  @import "./home.less";
  @import "../styles/common.less";
</style>
<template>
  <div class="home-main">
    <div class="show-name">
      狮子老爸音频管理平台
    </div>
  </div>
</template>

<script>
  import homeMap from './components/map.vue';
  import serviceRequests from './components/serviceRequests.vue';
  import userFlow from './components/userFlow.vue';
  import countUp from './components/countUp.vue';
  import inforCard from './components/inforCard.vue';
  import mapDataTable from './components/mapDataTable.vue';
  import toDoListItem from './components/toDoListItem.vue';
  import Util from '../../libs/util';

  import echartsBar from './components/echarts-bar.vue';
  import echartsLine from './components/echarts-line.vue';
  import echartsPie from './components/echarts-pie.vue';
  import echartsHeatmap from './components/echarts-heatmap.vue';

  export default {
    name: 'home',
    components: {
      homeMap,
      serviceRequests,
      userFlow,
      countUp,
      inforCard,
      mapDataTable,
      toDoListItem,
      echartsBar,
      echartsLine,
      echartsPie,
      echartsHeatmap,
    },
    data () {
      return {
        app_apk_img: Util.app_apk_img,
        home_img_login: Util.home_img_login,
        home_img_work: Util.home_img_work,
        autoplaySpeed: 4000,
        charts_div_width: 350,
        charts_line_width: 700,
        // 颜色
        colorObj: Util.constant.colorObj,
      };
    },
    computed: {},
    mounted: function () {
      var _this = this;
    },
    beforeCreate: function () {
      var _this = this;
    },
    beforeMount: function () {
      var _this = this;
    },
    beforeUpdate: function () {
      var _this = this;
    },
    updated: function () {
      var _this = this;
    },
    beforeDestroy: function () {
      var _this = this;
    },
    destroyed: function () {
      var _this = this;
    },
    created: function () {
      var _this = this;
      var mainWidth = $('#main').width();
      var charts_div_width = ( mainWidth - 100 - 32 - 32 - 2 ) / 2;
      if (charts_div_width > 350) {
        _this.charts_div_width = charts_div_width;
      }
      _this.charts_line_width = ( mainWidth - 32 - 32 - 2 );

      var title = Util.title(); // 页面标题
      var page_icon = Util.page_icon; // 页面ico
      window.document.title = title;
      // 设置ico
      var linkEle = document.getElementById("link_icon_id");
      linkEle.href = '/vendors/images/' + page_icon;
      linkEle.type = '';
      linkEle.type = 'image/x-icon';

    },
    methods: {}
  };
</script>
